Skip to content

DSAMind adoption: engine format fixes + version-axis amendment (F-II)#3

Merged
chinmaygit merged 5 commits into
mainfrom
relaxed-gould-8278fc
Jul 5, 2026
Merged

DSAMind adoption: engine format fixes + version-axis amendment (F-II)#3
chinmaygit merged 5 commits into
mainfrom
relaxed-gould-8278fc

Conversation

@chinmaygit

Copy link
Copy Markdown
Owner

Summary

  • Engine fixes found dogfooding against DSAMind's real constitution (cli/src/engine/{parse,audit}.ts): titled P-lines, section-grouped #### Article headings, Serves parenthetical commentary, SUPERSEDED — <date> status, and LEDGER-SYNC incorrectly firing for non-self-hosted consumers. DSAMind's audit went from 1 real error buried in 12 false positives to 16 real errors + 6 real warnings — 5 of which independently match DSAMind's own hand-audited mechanization backlog.
  • constitution init is now safe to re-run on an existing consumer (cli/src/scaffold.ts): fixed a case-sensitive governance-map detection that would have duplicated DSAMind's custom map, and a blanket .gitignore .constitution/ rule that silently shadowed the ops-plane's own nested ignore rules (events.jsonl/proposals were meant to stay committed).
  • Ratified Article F-II amendment (ADR-0002): names three version facts — a consumer's own Amendments Ledger version, the framework spec version it has adopted (the header pin, a conformance claim), and the framework tooling installed (its own package manifest) — and gives each exactly one home, closing the exact conflation LEDGER-SYNC shipped. Ratified by Chinmay 2026-07-05; constitution.lock.json re-accepted to close the F-IV drift the amendment opened.
  • Version bumped 0.17.2 → 0.17.3 (header + cli/package.json, self-hosted versionSync).

Test plan

  • cd cli && npm run build — clean strict tsc
  • cd cli && npm test — 23/23 passing
  • constitution audit on this repo — 0 findings
  • constitution firewall — clean, lock accepted by Chinmay 2026-07-05
  • Dry-run init against a full copy of DSAMind — CONSTITUTION.md/AGENTS.md byte-identical before/after, only the two skills that actually changed upstream refreshed
  • Fresh-consumer dry run — events.jsonl stageable post-init, vendored templates/process still ignored

🤖 Generated with Claude Code

chinmaygit and others added 5 commits July 4, 2026 23:30
…titution

DSAMind is the first consumer with a constitution shaped independently of
this repo's own dogfood format. Pointing `constitution audit` at it surfaced
four real parser/audit gaps, not hypothetical ones:

- P-line parser required bare `**P1.**`; DSAMind titles its P-lines
  (`**P1 — Title.**`) — now accepted, title folded into the statement text.
- Article parser required exactly `### Article <id>`; DSAMind groups Articles
  under `### §<section>` domain headings, one level deeper (`#### Article`) —
  now both levels accepted, and the bullet-block boundary widened to match.
- Serves-list parsing choked on inline parenthetical commentary per P-id,
  fragmenting on commas inside the parens and reading real Articles as
  serving nothing — parens are now stripped before splitting.
- ART-STATUS rejected `SUPERSEDED — <date>`, the exact shape `ratify-amendment`
  itself produces.
- LEDGER-SYNC fired unconditionally, comparing the framework pin against the
  ledger's own version axis — only valid for `selfHosted` instances. Wired the
  already-parsed but never-read `selfHosted` field into this one check.

Verified: self-audit on this repo stays 0 findings (no regression); DSAMind's
audit output went from 1 real error + 12 false-positive warnings to 16 real
errors + 6 real warnings — including 5 ART-MECH-DEBT findings that
independently match DSAMind's own hand-audited mechanization backlog list.
21/21 tests pass (2 new, covering the format variance + LEDGER-SYNC scoping).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…nsumer

Found trying to upgrade DSAMind (scaffolded before this overhaul, compiled
skills stuck at pre-engine versions). setupAgents already unconditionally
refreshes every compiled SKILL.md, so re-running `init` looked like the
right update mechanism — but two bugs made it unsafe:

- The "does AGENTS.md already have a governance map" check was
  case-sensitive (`includes('Governance Map')`), while the engine's own
  detection (engine/parse.ts) is case-insensitive. A consumer's real heading
  ("## Governance map (entry point)") would read as absent, and init would
  append a duplicate generic block on top of an already-customized map.
- scaffold.ts wrote a blanket `.constitution/` line to the root .gitignore.
  events.ts's ensureOps writes its own nested .constitution/.gitignore
  specifically so events.jsonl/proposals stay committed while
  tone/compiles/board.html regenerate — a parent-directory ignore rule
  makes git never even look for that narrower exception (verified
  empirically), silently swallowing the delivery record and ratification
  queue the ops-plane design explicitly means to keep. Scoped the ignore to
  just the regenerable vendored copies (templates/, process/).

Verified: dry-run init against a full copy of DSAMind leaves CONSTITUTION.md/
AGENTS.md byte-identical and only rewrites the two skills that actually
changed upstream; a fresh-consumer dry run confirms events.jsonl is
stageable post-init. 25/25 tests (2 new).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Operator asked where the installed framework tooling version should be
tracked for a consumer (vs. the adopted-spec header pin vs. the product's
own ledger version), and invoked /propose-amendment on the idea. Drafted,
not ratified.

decisions/0002-version-axis-separation.md proposes extending Article F-II
("one home per rule") to name three distinct version facts and assign each
exactly one home: an instance's own Amendments Ledger version; the framework
spec version it has deliberately adopted (the CONSTITUTION.md header pin —
a ratified conformance claim, never auto-bumped past what's adopted); and
the framework tooling actually installed (the consumer's own package
manifest, e.g. package.json's @chinmaygit/constitution-cli entry — no new
field needed, confirming the operator's instinct). Evidenced by this
session's actual LEDGER-SYNC bug (fixed in code, not yet in law). Agreement-
only, with the reason on record — no catch-rate/friction hypothesis to
measure.

Explicitly did not rule on the operator's second idea (skills self-check
tooling currency and auto-run migrations): no concrete mechanism exists yet
to evaluate, and "auto-update tooling unattended" is a supply-chain-trust
question separate from version-tracking. Recorded as deferred follow-up
engineering work in the ADR's Consequences, not folded into this amendment.

CONSTITUTION.md itself is untouched — the drafted F-II text lives only in
the ADR; only ratify-amendment may write it into ratified law. decisions/
INDEX.md updated in the same change per decisions/AGENTS.md's own statute.
constitution audit + firewall both stay clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Operator feedback: the first draft was too dense to follow. Cut nested
parentheticals and legal-brief phrasing; kept the same three-axis ruling,
the same evidence, the same deferred item.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Ratified by Chinmay, 2026-07-05: "makes sense lets ratify this."

Extends Article F-II's Principle and Fitness (status: RATIFIED, unchanged)
to name three version facts and give each exactly one home: an instance's
own Amendments Ledger version, the framework spec version it has adopted
(the header pin -- a ratified claim, never bumped ahead of what's adopted),
and the framework tooling installed (the instance's own package manifest).
Purely additive -- nothing existing changed or was superseded.

Agreement-only, no pre-registered experiment -- there was no catch-rate or
friction hypothesis to measure. The operator's second idea (skills
auto-checking tooling currency and auto-migrating) is explicitly NOT part
of this amendment -- no mechanism exists yet to rule on it.

ADR-0002 flipped proposed -> accepted; decisions/INDEX.md updated. Version
bumped 0.17.2 -> 0.17.3 (header + cli/package.json via constitution doctor's
versionSync). Dogfood test's ADR count updated 1 -> 2. constitution.lock.json
re-accepted by the ratifier to close the F-IV drift this change opened.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@chinmaygit chinmaygit merged commit b132932 into main Jul 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant